// pages/success/success.js
Page({
    data: {
        message: '支付成功',
        time: 4,
        myInterval: null
    },

    onLoad(option) {
 
        let myInterval = setInterval(() => {
            this.deleteTime()
        }, 1000)
        this.setData({
            myInterval: myInterval
        })
    },

    deleteTime() {
        if (this.data.time <= 1) {
            clearInterval(this.data.myInterval)
            wx.reLaunch({
                url: '/pages/person/order/order'
              })
        } else {
            this.setData({
                time: this.data.time - 1
            })
        }
    }
})